<?php
/**
 * The Template for displaying all single posts.
 *
 * @package _s
 */
get_header ();
?>

<div class="page_width">
	<div class="pagebox">
		<div class="navigate_path"><?php if (function_exists('wp_bac_breadcrumb')) {wp_bac_breadcrumb();}?></div>
	</div>
	
	<?php while (have_posts()) : the_post(); ?>
	<div class="pagebox">
		<div class="article_left">
			<div class="article_img">
			<?php
				$picurl = get_post_meta ( $post->ID, 'haikuo_pic_url', true );
				if (has_post_thumbnail ()) {
					$img_id = get_post_thumbnail_id ();
					$img_url = wp_get_attachment_image_src ( $img_id );
					$img_url = $img_url [0];
					$img_url_full = $img_url . '_full.jpg';
					$array1 = get_headers ( $img_url_full );
					if ($array1 [0] == 'HTTP/1.1 200 OK') {
					} else {
						$img_url = get_bloginfo ( "template_url" ) . '/timthumb.php?src=' . $img_url . '&amp;q=90&amp;w=270';
					}
				} else if (! empty ( $picurl )) {
					$img_url = get_bloginfo ( "template_url" ) . '/timthumb.php?src=' . $picurl . '&amp;q=90&amp;w=270';
				} else {
					$img_url = get_post_img ( '', 270, '' );
				}
				echo '<img src="' . $img_url . '" alt="' . $post->post_title . '" />'?>
			</div>
			<div id="good_info" class="article_info clearfix">
				<h1><?php the_title();?></h1>
				<div class="bdshare clearfix">
					<em>分享给好友：</em>
					<!-- Baidu Button BEGIN -->
					<div id="bdshare" class="bdsharebuttonbox">
						<a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a>
						<a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a>
						<a href="#" class="bds_tqq" data-cmd="tqq" title="分享到腾讯微博"></a>
						<a href="#" class="bds_renren" data-cmd="renren" title="分享到人人网"></a>
						<a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a>
						<a href="#" class="bds_more" data-cmd="more">更多</a>
					</div>
					<!-- Baidu Button END -->
				</div>
				<div class="click_buy clearfix">
					<?php $user_go_url = get_post_meta ( $post->ID, 'good_gourl', true );
					$gprice = get_post_meta ( $post->ID, "good_price", true );
					if (empty ( $gprice )) {
						$gprice = '0.00';
					}
					if (! empty ( $user_go_url )) { ?>
					<a href="<?php echo $user_go_url;?>" class="gobuy_btn" rel="nofollow" target="_blank">
						<span>¥<?php echo $gprice; ?></span>
					</a>
					<?php }?>
				</div>
				<br class="clear" />
				<div class="article_tags clearfix"><?php the_tags('<em>主题：</em>','','' );?></div>
				<div class="more_comment clearfix">
					<a href="#combook">查看用户评论>></a>
				</div>
				<!--<div class="pre_next">
					<?php if (get_previous_post()) { ?>
					<div class="nav-previous"><span class="gray">下一篇：</span>&nbsp;
						<?php previous_post_link ( '%link', '%title', TRUE ); ?>
					</div>
					<?php } if (get_next_post ()) { ?>
					<div class="nav-next"><span class="gray">上一篇：</span>&nbsp;
					<?php next_post_link ( '%link', '%title', TRUE ); ?>
					</div>
					<?php }?>
				</div>-->
			</div>
			<br class="clear" />
	
			<h2>宝贝详情：</h2>
			<div class="article_body">
				<?php the_content(); ?>
			</div>
			<a id="combook" name="combook"></a>
			<div id="comments">
				<?php comments_template(); ?>
			</div>
		</div>
		<?php endwhile; // end of the loop. ?>
		<?php get_sidebar(); ?>
	</div>
</div>
<?php get_footer(); ?>